package com.coda.app.mapper;

import com.coda.app.annotation.AutoFill;
import com.coda.entity.LeaseAgreement;
import com.coda.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LeaseAgreementMapper {
    /**
     * 获取个人租约基本信息
     */
    List<LeaseAgreement> getList(Long id);

    /**
     * 根据id获取租约详细信息
     * @param id
     * @return
     */
    @Select("select * from lease_agreement where id = #{id}")
    LeaseAgreement getDetail(Long id);

    /**
     * 保存租约
     * @param leaseAgreement
     */
    @AutoFill(OperationType.INSERT)
    void insert(LeaseAgreement leaseAgreement);

    /**
     * 更新租约信息
     * @param leaseAgreement
     */
    void update(LeaseAgreement leaseAgreement);
}
